{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "%reload_ext autoreload\n",
    "%autoreload 2\n",
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = 'all'\n",
    "import sys\n",
    "sys.path.append('../')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "new_energy_capacity = pd.read_excel(\"./data/A/1.样例数据（甲）.xls\", sheet_name=\"新能源\")\n",
    "windA_capacity, solarA_capacity = new_energy_capacity['风电装机(MW)'].loc[0], new_energy_capacity['光伏装机(MW)'].loc[0]\n",
    "windB_capacity, solarB_capacity = new_energy_capacity['风电装机(MW)'].loc[1], new_energy_capacity['光伏装机(MW)'].loc[1]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期</th>\n",
       "      <th>时间</th>\n",
       "      <th>A分区</th>\n",
       "      <th>Unnamed: 3</th>\n",
       "      <th>Unnamed: 4</th>\n",
       "      <th>Unnamed: 5</th>\n",
       "      <th>B分区</th>\n",
       "      <th>Unnamed: 7</th>\n",
       "      <th>Unnamed: 8</th>\n",
       "      <th>Unnamed: 9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaT</td>\n",
       "      <td>NaN</td>\n",
       "      <td>风电</td>\n",
       "      <td>NaN</td>\n",
       "      <td>光伏</td>\n",
       "      <td>NaN</td>\n",
       "      <td>风电</td>\n",
       "      <td>NaN</td>\n",
       "      <td>光伏</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NaT</td>\n",
       "      <td>NaN</td>\n",
       "      <td>预测出力(MW)</td>\n",
       "      <td>实际出力(MW)</td>\n",
       "      <td>预测出力(MW)</td>\n",
       "      <td>实际出力(MW)</td>\n",
       "      <td>预测出力(MW)</td>\n",
       "      <td>实际出力(MW)</td>\n",
       "      <td>预测出力(MW)</td>\n",
       "      <td>实际出力(MW)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2000-01-01</td>\n",
       "      <td>00:00:00</td>\n",
       "      <td>1831.9</td>\n",
       "      <td>2646.36</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1196.97</td>\n",
       "      <td>1358.52</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2000-01-01</td>\n",
       "      <td>01:00:00</td>\n",
       "      <td>1538.55</td>\n",
       "      <td>2437.29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1170.76</td>\n",
       "      <td>1245.16</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2000-01-01</td>\n",
       "      <td>02:00:00</td>\n",
       "      <td>1301.72</td>\n",
       "      <td>2311.39</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1145.39</td>\n",
       "      <td>1310.5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          日期        时间       A分区 Unnamed: 3 Unnamed: 4 Unnamed: 5       B分区  \\\n",
       "0        NaT       NaN        风电        NaN         光伏        NaN        风电   \n",
       "1        NaT       NaN  预测出力(MW)   实际出力(MW)   预测出力(MW)   实际出力(MW)  预测出力(MW)   \n",
       "2 2000-01-01  00:00:00    1831.9    2646.36          0          0   1196.97   \n",
       "3 2000-01-01  01:00:00   1538.55    2437.29          0          0   1170.76   \n",
       "4 2000-01-01  02:00:00   1301.72    2311.39          0          0   1145.39   \n",
       "\n",
       "  Unnamed: 7 Unnamed: 8 Unnamed: 9  \n",
       "0        NaN         光伏        NaN  \n",
       "1   实际出力(MW)   预测出力(MW)   实际出力(MW)  \n",
       "2    1358.52          0          0  \n",
       "3    1245.16          0          0  \n",
       "4     1310.5          0          0  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "array([1831.9, 1538.55, 1301.72, ..., 1402.01, 1268.48, 1134.34],\n",
       "      dtype=object)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "new_energy = pd.read_excel(\"./data/A/2.新能源时序（甲）.xlsx\")\n",
    "new_energy.head()\n",
    "wind = new_energy.iloc[2:, 2:4].values\n",
    "wind[:,0].reshape(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>序号</th>\n",
       "      <th>节点名称</th>\n",
       "      <th>厂站名称</th>\n",
       "      <th>燃料类型</th>\n",
       "      <th>所属区域</th>\n",
       "      <th>装机容量（MW）</th>\n",
       "      <th>最大出力1(PU.)</th>\n",
       "      <th>最大出力2(PU.)</th>\n",
       "      <th>最小出力1(PU.)</th>\n",
       "      <th>最小出力2(PU.)</th>\n",
       "      <th>开始供热</th>\n",
       "      <th>结束供热</th>\n",
       "      <th>标煤耗率（g/kWh）</th>\n",
       "      <th>煤耗系数A</th>\n",
       "      <th>煤耗系数B</th>\n",
       "      <th>煤耗系数C</th>\n",
       "      <th>燃料成本（元/吨标煤）\\n燃气的成本（元/吨标煤）</th>\n",
       "      <th>碳排放强度\\n（kgCO2/kg标准煤）</th>\n",
       "      <th>年平均检修时间\\n（天）</th>\n",
       "      <th>启停成本\\n（万元）</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>SBU1</td>\n",
       "      <td>SBU\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>350</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.6</td>\n",
       "      <td>NaT</td>\n",
       "      <td>NaT</td>\n",
       "      <td>320</td>\n",
       "      <td>1.2246</td>\n",
       "      <td>-0.4023</td>\n",
       "      <td>0.1777</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>30</td>\n",
       "      <td>26.515152</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>SBU2</td>\n",
       "      <td>SBU\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>350</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.7</td>\n",
       "      <td>NaT</td>\n",
       "      <td>NaT</td>\n",
       "      <td>320</td>\n",
       "      <td>1.2246</td>\n",
       "      <td>-0.4023</td>\n",
       "      <td>0.1777</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>30</td>\n",
       "      <td>26.515152</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>SFV1</td>\n",
       "      <td>SFV\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>300</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaT</td>\n",
       "      <td>NaT</td>\n",
       "      <td>320</td>\n",
       "      <td>1.2246</td>\n",
       "      <td>-0.4023</td>\n",
       "      <td>0.1777</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>45</td>\n",
       "      <td>22.727273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>SFV2</td>\n",
       "      <td>SFV\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>300</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.5</td>\n",
       "      <td>2023-10-15</td>\n",
       "      <td>2023-04-15</td>\n",
       "      <td>320</td>\n",
       "      <td>1.2246</td>\n",
       "      <td>-0.4023</td>\n",
       "      <td>0.1777</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>45</td>\n",
       "      <td>22.727273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>SPD</td>\n",
       "      <td>SPD\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>270</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.6</td>\n",
       "      <td>NaT</td>\n",
       "      <td>NaT</td>\n",
       "      <td>320</td>\n",
       "      <td>1.2246</td>\n",
       "      <td>-0.4023</td>\n",
       "      <td>0.1777</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>30</td>\n",
       "      <td>20.454545</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>SJF1</td>\n",
       "      <td>SJF\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>660</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaT</td>\n",
       "      <td>NaT</td>\n",
       "      <td>309</td>\n",
       "      <td>1.3055</td>\n",
       "      <td>-0.6460</td>\n",
       "      <td>0.3423</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>45</td>\n",
       "      <td>50.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>SJF2</td>\n",
       "      <td>SJF\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>660</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaT</td>\n",
       "      <td>NaT</td>\n",
       "      <td>309</td>\n",
       "      <td>1.3055</td>\n",
       "      <td>-0.6460</td>\n",
       "      <td>0.3423</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>45</td>\n",
       "      <td>50.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>SMO</td>\n",
       "      <td>SMO\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>240</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaT</td>\n",
       "      <td>NaT</td>\n",
       "      <td>320</td>\n",
       "      <td>1.2246</td>\n",
       "      <td>-0.4023</td>\n",
       "      <td>0.1777</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>30</td>\n",
       "      <td>18.181818</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>SZZ</td>\n",
       "      <td>SZZ\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>325</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.5</td>\n",
       "      <td>2023-10-15</td>\n",
       "      <td>2023-04-15</td>\n",
       "      <td>320</td>\n",
       "      <td>1.2246</td>\n",
       "      <td>-0.4023</td>\n",
       "      <td>0.1777</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>30</td>\n",
       "      <td>24.621212</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>SVJ</td>\n",
       "      <td>SVJ\\n</td>\n",
       "      <td>煤炭</td>\n",
       "      <td>A</td>\n",
       "      <td>295</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.6</td>\n",
       "      <td>NaT</td>\n",
       "      <td>NaT</td>\n",
       "      <td>320</td>\n",
       "      <td>1.2246</td>\n",
       "      <td>-0.4023</td>\n",
       "      <td>0.1777</td>\n",
       "      <td>580</td>\n",
       "      <td>2.6631</td>\n",
       "      <td>30</td>\n",
       "      <td>22.348485</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   序号  节点名称   厂站名称 燃料类型 所属区域  装机容量（MW）  最大出力1(PU.)  最大出力2(PU.)  最小出力1(PU.)  \\\n",
       "0   1  SBU1  SBU\\n   煤炭    A       350           1         0.9         0.5   \n",
       "1   2  SBU2  SBU\\n   煤炭    A       350           1         1.0         0.5   \n",
       "2   3  SFV1  SFV\\n   煤炭    A       300           1         0.9         0.5   \n",
       "3   4  SFV2  SFV\\n   煤炭    A       300           1         0.9         0.5   \n",
       "4   5   SPD  SPD\\n   煤炭    A       270           1         0.9         0.5   \n",
       "5   6  SJF1  SJF\\n   煤炭    A       660           1         0.9         0.5   \n",
       "6   7  SJF2  SJF\\n   煤炭    A       660           1         1.0         0.5   \n",
       "7   8   SMO  SMO\\n   煤炭    A       240           1         0.9         0.5   \n",
       "8   9   SZZ  SZZ\\n   煤炭    A       325           1         0.9         0.5   \n",
       "9  10   SVJ  SVJ\\n   煤炭    A       295           1         0.9         0.5   \n",
       "\n",
       "   最小出力2(PU.)       开始供热       结束供热  标煤耗率（g/kWh）   煤耗系数A   煤耗系数B   煤耗系数C  \\\n",
       "0         0.6        NaT        NaT          320  1.2246 -0.4023  0.1777   \n",
       "1         0.7        NaT        NaT          320  1.2246 -0.4023  0.1777   \n",
       "2         0.5        NaT        NaT          320  1.2246 -0.4023  0.1777   \n",
       "3         0.5 2023-10-15 2023-04-15          320  1.2246 -0.4023  0.1777   \n",
       "4         0.6        NaT        NaT          320  1.2246 -0.4023  0.1777   \n",
       "5         0.5        NaT        NaT          309  1.3055 -0.6460  0.3423   \n",
       "6         0.5        NaT        NaT          309  1.3055 -0.6460  0.3423   \n",
       "7         0.5        NaT        NaT          320  1.2246 -0.4023  0.1777   \n",
       "8         0.5 2023-10-15 2023-04-15          320  1.2246 -0.4023  0.1777   \n",
       "9         0.6        NaT        NaT          320  1.2246 -0.4023  0.1777   \n",
       "\n",
       "   燃料成本（元/吨标煤）\\n燃气的成本（元/吨标煤）  碳排放强度\\n（kgCO2/kg标准煤）  年平均检修时间\\n（天）  启停成本\\n（万元）  \n",
       "0                        580                2.6631            30   26.515152  \n",
       "1                        580                2.6631            30   26.515152  \n",
       "2                        580                2.6631            45   22.727273  \n",
       "3                        580                2.6631            45   22.727273  \n",
       "4                        580                2.6631            30   20.454545  \n",
       "5                        580                2.6631            45   50.000000  \n",
       "6                        580                2.6631            45   50.000000  \n",
       "7                        580                2.6631            30   18.181818  \n",
       "8                        580                2.6631            30   24.621212  \n",
       "9                        580                2.6631            30   22.348485  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "info = pd.read_excel(\"./data/A/1.样例数据（甲）.xls\", sheet_name=\"热力电厂\")\n",
    "info = info.groupby('所属区域')\n",
    "fireA = info.get_group('A')\n",
    "fireA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "info = pd.read_excel(\"./data/A/1.样例数据（甲）.xls\", sheet_name=\"联络线\")\n",
    "info.head()\n",
    "info['正向输电能力（MW）'].loc[1]\n",
    "other = pd.read_excel(\"./data/A/4.联络线曲线（甲）.xlsx\")\n",
    "other.head()\n",
    "a_out = other['A区外送直流（PU.）'].values * info['正向输电能力（MW）'].loc[2]\n",
    "b_out = other['B区外送直流（PU.）'].values * info['正向输电能力（MW）'].loc[3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期</th>\n",
       "      <th>时间</th>\n",
       "      <th>A分区</th>\n",
       "      <th>B分区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaT</td>\n",
       "      <td>NaN</td>\n",
       "      <td>实际负荷(MW)</td>\n",
       "      <td>实际负荷(MW)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2000-01-01</td>\n",
       "      <td>00:00:00</td>\n",
       "      <td>10053.78</td>\n",
       "      <td>16148.096</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2000-01-01</td>\n",
       "      <td>01:00:00</td>\n",
       "      <td>9918.78</td>\n",
       "      <td>15695.414</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2000-01-01</td>\n",
       "      <td>02:00:00</td>\n",
       "      <td>9805.77</td>\n",
       "      <td>15760.684</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2000-01-01</td>\n",
       "      <td>03:00:00</td>\n",
       "      <td>9849.23</td>\n",
       "      <td>15747.173</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          日期        时间       A分区        B分区\n",
       "0        NaT       NaN  实际负荷(MW)   实际负荷(MW)\n",
       "1 2000-01-01  00:00:00  10053.78  16148.096\n",
       "2 2000-01-01  01:00:00   9918.78  15695.414\n",
       "3 2000-01-01  02:00:00   9805.77  15760.684\n",
       "4 2000-01-01  03:00:00   9849.23  15747.173"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "info_load = pd.read_excel(\"./data/A/1.样例数据（甲）.xls\", sheet_name='负荷')\n",
    "info_load.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([10053.78, 9918.78, 9805.77, ..., 11554.41, 11367.92, 11237.02],\n",
       "      dtype=object)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "loadA = info_load['A分区'].loc[1:].values.reshape(-1)\n",
    "loadB = info_load['B分区'].loc[1:].values.reshape(-1)\n",
    "loadA\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>节点名称</th>\n",
       "      <th>厂站名称</th>\n",
       "      <th>分区</th>\n",
       "      <th>储能类别</th>\n",
       "      <th>储能容量\\n（MW）</th>\n",
       "      <th>发电容量小时数\\n(小时)</th>\n",
       "      <th>年发电小时设计值\\n（小时）</th>\n",
       "      <th>充放电效率</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>抽蓄1</td>\n",
       "      <td>抽蓄A</td>\n",
       "      <td>A</td>\n",
       "      <td>抽蓄</td>\n",
       "      <td>300</td>\n",
       "      <td>4</td>\n",
       "      <td>1200</td>\n",
       "      <td>0.78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>电化学储能1</td>\n",
       "      <td>电化学A</td>\n",
       "      <td>A</td>\n",
       "      <td>电化学</td>\n",
       "      <td>300</td>\n",
       "      <td>2</td>\n",
       "      <td>650</td>\n",
       "      <td>0.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>抽蓄2</td>\n",
       "      <td>抽蓄B</td>\n",
       "      <td>B</td>\n",
       "      <td>抽蓄</td>\n",
       "      <td>300</td>\n",
       "      <td>4</td>\n",
       "      <td>1200</td>\n",
       "      <td>0.78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>电化学储能2</td>\n",
       "      <td>电化学B</td>\n",
       "      <td>B</td>\n",
       "      <td>电化学</td>\n",
       "      <td>300</td>\n",
       "      <td>2</td>\n",
       "      <td>650</td>\n",
       "      <td>0.90</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     节点名称  厂站名称 分区 储能类别  储能容量\\n（MW）  发电容量小时数\\n(小时)  年发电小时设计值\\n（小时）  充放电效率\n",
       "0     抽蓄1   抽蓄A  A   抽蓄         300              4            1200   0.78\n",
       "1  电化学储能1  电化学A  A  电化学         300              2             650   0.90\n",
       "2     抽蓄2   抽蓄B  B   抽蓄         300              4            1200   0.78\n",
       "3  电化学储能2  电化学B  B  电化学         300              2             650   0.90"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "storage_info = pd.read_excel(\"./data/A/1.样例数据（甲）.xls\", sheet_name='储能')\n",
    "storage_info.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>节点名称</th>\n",
       "      <th>厂站名称</th>\n",
       "      <th>分区</th>\n",
       "      <th>储能类别</th>\n",
       "      <th>储能容量\\n（MW）</th>\n",
       "      <th>发电容量小时数\\n(小时)</th>\n",
       "      <th>年发电小时设计值\\n（小时）</th>\n",
       "      <th>充放电效率</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>抽蓄2</td>\n",
       "      <td>抽蓄B</td>\n",
       "      <td>B</td>\n",
       "      <td>抽蓄</td>\n",
       "      <td>300</td>\n",
       "      <td>4</td>\n",
       "      <td>1200</td>\n",
       "      <td>0.78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>电化学储能2</td>\n",
       "      <td>电化学B</td>\n",
       "      <td>B</td>\n",
       "      <td>电化学</td>\n",
       "      <td>300</td>\n",
       "      <td>2</td>\n",
       "      <td>650</td>\n",
       "      <td>0.90</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     节点名称  厂站名称 分区 储能类别  储能容量\\n（MW）  发电容量小时数\\n(小时)  年发电小时设计值\\n（小时）  充放电效率\n",
       "2     抽蓄2   抽蓄B  B   抽蓄         300              4            1200   0.78\n",
       "3  电化学储能2  电化学B  B  电化学         300              2             650   0.90"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "storage_info = storage_info.groupby(\"分区\")\n",
    "storageA = storage_info.get_group('A')\n",
    "storageB = storage_info.get_group('B')\n",
    "storageA.head()\n",
    "storageB.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "抽蓄1\n",
      "电化学储能1\n"
     ]
    }
   ],
   "source": [
    "for i in range(len(storageA)):\n",
    "    print(storageA['节点名称'].loc[i])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pytorch",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
